<?php
/**
 * LilFloatEngineTest file
 *
 */
App::uses('LilFloatEngine', 'LilFloat.Lib');
/**
 * LilFloatEngineTest class
 *
 * @package       lil
 */
class LilFloatEngineTest extends CakeTestCase {
/**
 * testLilFloatEngineFormat method
 *
 * @access public
 * @return void
 */
	function testLilFloatEngineFormat() {
		$e = LilFloatEngine::getInstance();
		$e->setDecimalSeparator(',');
		$e->setThousandsSeparator(' ');
		
		$result = $e->format('1234.56', array('places' => 2));
		$expected = '1 234,56';
		
		$this->assertEqual($result, $expected);
	}
/**
 * testLilFloatEngineDelocalize method
 *
 * @access public
 * @return void
 */
	function testLilFloatEngineDelocalize() {
		$e = LilFloatEngine::getInstance();
		$e->setDecimalSeparator(',');
		$e->setThousandsSeparator('.');
		
		$result = $e->delocalize('1.234,56');
		$expected = '1234.56';
		$this->assertEqual($result, $expected);
		
		$result = $e->delocalize('1234,56');
		$expected = '1234.56';
		$this->assertEqual($result, $expected);
		
		$result = $e->delocalize('-1.234,56');
		$expected = '-1234.56';
		$this->assertEqual($result, $expected);
	}
}